<form method="post" action="" id="tbl_base_roleForm">
<table cellspacing='1' cellpadding='1' width="100%" class="table2" bgcolor="#ebeced">
	<tr><td colspan='3'>
	{$error}
	</td></tr>
	<tr>
		<th width="120" height="40">
			角色名称:
		</th>
		<td width="200px">
			<input type="text" id="txt_role_name" name="txt_role_name" />
		</td>
		<td>
			<div id="txt_role_name_tip"></div>
		</td>
	</tr>
	<tr>
		<th align="right">
			描述:
		</th>
		<td>
			<input type="text" id="txt_description" name="txt_description" />
		</td>
		<td>
			<div id="txt_description_tip"></div>
		</td>
	</tr>
	<tr>
    	<th align="right">角色权限:</th>
    <td colspan="2">
    	<table>
    	<tr>
    	<td>
    	{foreach from=$rightData item=mg}
        <strong>{$mg.group_name}</strong><br />
        {foreach from=$mg.modules item=m}
            <span class="mName"><input type="checkbox" id="chk_{$m.module_id}" onclick="selectAllRole(this,'{$m.module_id}[]')" /><label for="chk_{$m.module_id}" class="orange">{$m.module_name}：</label></span>
            {foreach from=$m.rights item=r}
              {if $r.right_value!=""}
                <input type="checkbox" name="{$m.module_id}[]" id="chk_{$m.module_id}_{$r.module_right_id}" value="{$r.right_value}" /><label for="chk_{$m.module_id}_{$r.module_right_id}">{$r.right_name}</label>&nbsp;&nbsp;
               {/if}              
            {/foreach}
             <br />  
        {/foreach}
             
		{/foreach}
		
    	</td></tr>
    	</table>    
		</td>
	</tr> 
	<tr>
		<th></th>
		<td colspan="2">
			<div style="margin-right:10px;" class="left"><a class="buttonStyle" onclick="{literal}if($.formValidator.pageIsValid()){document.getElementById('tbl_base_roleForm').submit();}{/literal}"><span></span>添加</a></div>
    	<div class="left"><a class="buttonStyle" href="{$manageDomain}roleManage/show/"><span></span>返回</a></div>
		</td>
	</tr>
</table>
</form>
<script>
{literal}
function selectAllRole(objthis,obj)
{
	//全选功能
	
	roleObj=document.getElementsByName(obj);
			
	for(i=0;i<roleObj.length;i++)
	{

		roleObj[i].checked=objthis.checked;		
	}
}
{/literal}
</script>